package com.jianan.mis.data.domain.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the employee_group table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="employee_group"
 */

public abstract class BaseEmployeeGroup  implements Serializable {

	public static String REF = "EmployeeGroup";


	// constructors
	public BaseEmployeeGroup () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseEmployeeGroup (
		com.jianan.mis.data.domain.Group group,
		com.jianan.mis.data.domain.Employee employee) {

		this.setGroup(group);
		this.setEmployee(employee);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key

	private com.jianan.mis.data.domain.Group group;

	private com.jianan.mis.data.domain.Employee employee;



	/**
     * @hibernate.property
     *  column=group_id
	 * not-null=true
	 */
	public com.jianan.mis.data.domain.Group getGroup () {
		return this.group;
	}

	/**
	 * Set the value related to the column: group_id
	 * @param group the group_id value
	 */
	public void setGroup (com.jianan.mis.data.domain.Group group) {
		this.group = group;
		this.hashCode = Integer.MIN_VALUE;
	}

	/**
     * @hibernate.property
     *  column=employee_id
	 * not-null=true
	 */
	public com.jianan.mis.data.domain.Employee getEmployee () {
		return this.employee;
	}

	/**
	 * Set the value related to the column: employee_id
	 * @param employee the employee_id value
	 */
	public void setEmployee (com.jianan.mis.data.domain.Employee employee) {
		this.employee = employee;
		this.hashCode = Integer.MIN_VALUE;
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jianan.mis.data.domain.EmployeeGroup)) return false;
		else {
			com.jianan.mis.data.domain.EmployeeGroup employeeGroup = (com.jianan.mis.data.domain.EmployeeGroup) obj;
			if (null != this.getGroup() && null != employeeGroup.getGroup()) {
				if (!this.getGroup().equals(employeeGroup.getGroup())) {
					return false;
				}
			}
			else {
				return false;
			}
			if (null != this.getEmployee() && null != employeeGroup.getEmployee()) {
				if (!this.getEmployee().equals(employeeGroup.getEmployee())) {
					return false;
				}
			}
			else {
				return false;
			}
			return true;
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			StringBuilder sb = new StringBuilder();
			if (null != this.getGroup()) {
				sb.append(this.getGroup().hashCode());
				sb.append(":");
			}
			else {
				return super.hashCode();
			}
			if (null != this.getEmployee()) {
				sb.append(this.getEmployee().hashCode());
				sb.append(":");
			}
			else {
				return super.hashCode();
			}
			this.hashCode = sb.toString().hashCode();
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}